package my.assistant.homecashmanager.inoutitem.data;

import java.sql.Date;

public class DmInoutItem {

	private long id;// 收支项目ID
	private String name;// 收支项目名称
	private String inouttype;// 收支项目类型，1:收入;0:支出;2:存取款;3:转账
	private String explain;// 收支项目说明
	private long parentid;// 上级收支项目的ID，如果无上级项目，则该值为0
	private String homeId;// 项目所属家庭。如果是系统内建项目，则该项为：10
	private boolean status;// 项目当前状态，true:正常;false:停用
	private Date opDate;// 操作时间，创建或修改该项目的时间
	private String creater;// 该收支项目的创建人
	private Date createDate;// 该收支项目的创建时间
	private int lft;
	private int rgt;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getInouttype() {
		return inouttype;
	}

	public void setInouttype(String inouttype) {
		this.inouttype = inouttype;
	}

	public String getExplain() {
		return explain;
	}

	public void setExplain(String explain) {
		this.explain = explain;
	}

	public long getParentid() {
		return parentid;
	}

	public void setParentid(long parentid) {
		this.parentid = parentid;
	}

	public String getHomeId() {
		return homeId;
	}

	public void setHomeId(String homeId) {
		this.homeId = homeId;
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public Date getOpDate() {
		return opDate;
	}

	public void setOpDate(Date opDate) {
		this.opDate = opDate;
	}

	public String getCreater() {
		return creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public int getLft() {
		return lft;
	}

	public void setLft(int lft) {
		this.lft = lft;
	}

	public int getRgt() {
		return rgt;
	}

	public void setRgt(int rgt) {
		this.rgt = rgt;
	}

	/**
	 * 判断该节点是否是叶子节点
	 * 
	 * @return
	 */
	public boolean isLeaf() {
		boolean leaf = false;
		if (getRgt() == (getLft() + 1)) {
			leaf = true;
		} else {
			leaf = false;
		}
		return leaf;
	}
}
